package com.seleniti.enpareja.web.desktop.client.ui.view;

import org.ioc.commons.impl.gwt.client.ui.HasLoaderWrapper;
import org.ioc.commons.impl.gwt.client.ui.ViewComposite;
import org.ioc.commons.ui.HasLoader;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
import com.seleniti.enpareja.controller.ui.view.AdminConsoleView;
import com.seleniti.enpareja.controller.ui.view.AdminConsoleView.Action;
import com.seleniti.enpareja.controller.ui.view.AdminConsoleView.Event;
import com.seleniti.enpareja.controller.ui.view.AdminConsoleView.Operation;
import com.seleniti.enpareja.controller.ui.view.AdminConsoleView.Presenter;
import com.seleniti.enpareja.controller.ui.view.AdminConsoleViewPresenter;

public class AdminConsoleViewWidget extends EnParejaBaseView<Event, Operation, Action, Presenter> implements
		AdminConsoleView {

	private static AdminConsoleViewWidgetUiBinder uiBinder = GWT.create(AdminConsoleViewWidgetUiBinder.class);

	interface AdminConsoleViewWidgetUiBinder extends UiBinder<Widget, AdminConsoleViewWidget> {
	}
	
	@UiField
	Label lblFixingInc;

	public AdminConsoleViewWidget() {
		this.presenter = new AdminConsoleViewPresenter(this, eventbus, operationManager, actionController);
		initWidget(uiBinder.createAndBindUi(this));
	}
	
	@UiHandler("btnRemoveNullsFromLists")
	void onRemoveNullsFromListsButtonClicked(ClickEvent evt) {
		this.presenter.onRemoveNullsFromLists();
	}

	@Override
	public HasLoader fixingInconsistentValuesIndicator() {
		return HasLoaderWrapper.fromVisible(lblFixingInc, this);
	}

}
